package frame.m.com.mylibrary.http;

/**
 * Created by Administrator on 2017/7/7.
 */

public class ApiException extends RuntimeException {
    public final static int USER_NOT_EXIST = 101;

    public ApiException(int resultCode) {
        this(getApiExceptionMessage(resultCode));
    }

    public ApiException(String message) {
        super(message);
    }

    private static String getApiExceptionMessage(int code) {
        String message;
        switch (code) {
            case USER_NOT_EXIST:
                message = "该用户不存在";
            default:
                message = "未知错误";
        }
        return message;
    }

}
